/**
 * Copyright (C)  2011  chen wei hua.
 * Permission is granted to copy, distribute and/or modify this document
 * under the terms of the GNU Free Documentation License, Version 2.0
 * or any later version published by the Free Software Foundation;
 * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
 * A copy of the license is included in the section entitled "GNU Free Documentation License".
 */
package com.javaeye.chenweihuacwh.util;

import org.springframework.beans.factory.xml.XmlBeanFactory;
import org.springframework.core.io.ClassPathResource;

/**
 * 取得spring bean工厂的帮助类
 * @author chen
 *
 */
public class BeanHelp {
	
	/**
	 * bean工厂
	 */
	private static XmlBeanFactory factory;
	
	/**
	 * bean工厂取得的方法
	 * @return bean工厂
	 */
	public static XmlBeanFactory getXmlBeanFactory() {
		if (factory == null) {
			ClassPathResource rs = new ClassPathResource("bean.xml");
			factory = new XmlBeanFactory(rs);
		}
		return factory;
	}

}
